#ifndef CONNECTOR_H
#define CONNECTOR_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QSslError>

#include <QList>
#include <QByteArray>


class Connector : public QObject
{
    Q_OBJECT

private:
	QNetworkAccessManager *m_pManager;
	QNetworkReply *m_pReply;
	QByteArray receivedData;

	uint m_redirectCount;
public:
    explicit Connector(QObject *parent = 0);
	~Connector();

	void connectToUrl(const QString &url);

signals:
	void dataReaded(QByteArray data);
private slots:
	void slotFinish();
	void slotError(QNetworkReply::NetworkError error);
	void slotSslErrors(QList<QSslError> errors);

};

#endif // CONNECTOR_H
